package lzy.impl.smallspring.beans.factory.support;

import lzy.impl.smallspring.core.io.DefaultResourceLoader;
import lzy.impl.smallspring.core.io.ResourceLoader;

/**
 * 只提供了读取resource的：
 * 前序能力（从path拿到Resource）
 * 后续容器（从resource里读到的东西要写到BeanDefinitionRegistry里）
 */
public abstract class AbstractBeanDefinitionReader implements BeanDefinitionReader{

    private final BeanDefinitionRegistry registry;

    private ResourceLoader resourceLoader;

    public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry) {
        this(registry, new DefaultResourceLoader());
    }
    public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry, ResourceLoader resourceLoader) {
        this.registry = registry;
        this.resourceLoader = resourceLoader;
    }

    @Override
    public BeanDefinitionRegistry getRegistry() {
        return registry;
    }

    @Override
    public ResourceLoader getResourceLoader() {
        return resourceLoader;
    }

}
